#ifndef GAMEDBINTERFACE_H
#define GAMEDBINTERFACE_H

#include "DiceGameIds.h"

class TrackSQL;
class CrapsConnection;
class DiceGame;


/***********************************************************************************************
* This class serves as a common interface that each individual game implements using their 
* specific database related logic.  This way the CrapsConnection object can make calls through
* the interface pointer without knowing what type of game it's actually dealing with.
*
* Additionally, some common logic which is database related, but isn't game specific also 
* lives in this class.
*
* kharmon.  06-16-06.  #3077.  Added for SicBo.
************************************************************************************************/
class GameDBInterface
{
public:
    GameDBInterface(CrapsConnection *pConn, TrackSQL *pSQL);
    virtual ~GameDBInterface();

    // call this to create an instance of the correct type of derived class
    static GameDBInterface * CreateInterface(CrapsConnection *pConn, TrackSQL *pSQL);

    // returns various balances for the current player
    bool8 trackGetBalance(int32 *balance, int32 *compBalance, int32 *bonusBalance);

    // forces a change in the player's balance...not normally used
    int32 trackAdjustBalance(int32 Amount);

    // tells the implementing object to load the various betting limits for the game
    virtual bool8 trackLoadOptions() = 0;

    // tells the implementing class to check for any unfinished games
    virtual bool8 trackHasSavedGame(DiceGame *& pGame, int32 *err) = 0;    

protected:
    CrapsConnection     *m_pConn;
    TrackSQL            *m_pTrackSQL;
};



#endif
